//
//  BHCircleDetailPlaceInfoCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/7/12.
//

import UIKit

class BHCircleDetailPlaceInfoCell: UITableViewCell {

    @IBOutlet weak var place_backView: UIView!
    
    @IBOutlet weak var name_label: UILabel!
    @IBOutlet weak var headerImgView: UIImageView!
    
    @IBOutlet weak var area_label: UILabel!
    
    @IBOutlet weak var distance_label: UILabel!
    
    @IBOutlet weak var adress_label: UILabel!
    
    var model: BHCircleDetailInfoModel! {
        didSet {
            self.headerImgView.sd_setImage(with: URL.init(string: model.relationPic), placeholderImage: nil, options: .retryFailed, context: nil)
            self.name_label.text = model.relationName
            self.area_label.text = "\(model.cityName)/\(model.areaName)"
            self.distance_label.isHidden = !BHLocationManager.shared.authed
            self.distance_label.text = "\(model.distance)m"
            self.adress_label.text = model.place
        }
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.place_backView.addLayerCorner(4, 0, .white)
        self.headerImgView.addLayerCorner(8, 0, .white)

    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        
    }
    
    static var cellHeight: CGFloat {
        get {
            return 140
        }
    }
    
}
